package com.lq.ecoldchain.entity

import android.os.Parcel
import android.os.Parcelable

/*
*2019/1/11 0011  14:21
*function by lq
*/
data class RecommendBean(
        val `field`: Any,
        val limit: Int,
        val list: List<RecommendOrder>,
        val order: Any,
        val page: Int,
        val total: Int
)

data class RecommendOrder(
        val soriginName: String,
        val adjustPrice: Int,
        val arrivalTime: Long,
        val bond: Int,
        val cancelReason: String,
        val cancelResponsiblePerson: String,
        val consignee: String,
        val consigneeContactWay: String,
        val consignor: String,
        val consignorContactWay: String,
        val createTime: Long,
        val cube: String,
        val departureTime: Long,
        val destination: String,
        val destinationName: String,
        val driverId: String,
        val driverPayServiceFee: String,
        val feedbacks: String,
        val goodsDescription: String,
        val goodsType: Int,
        val goodsTypeName: String,
        val id: Int,
        val introduceCreateTime: Long,
        val introduceFee: Int,
        val introduceOrderNum: Int,
        val introduceStatus: Int,
        val isDistribution: Any,
        val isGreenPass: Boolean,
        val isMeatHook: Boolean,
        val isTailstock: Boolean,
        val kilometre: Int,
        val loadNum: Int,
        val orderIntroduceId: Int,
        val orderNum: String,
        val origin: Int,
        val originName: String,
        val paymentMethod: Int,
        val proposalPrice: Int,
        val receiptTime: Long,
        val salePayServiceFee: String,
        val salePhone: String,
        val serviceId: Int,
        val status: Int,
        val temperatureRequireEnd: Int,
        val temperatureRequireId: Int,
        val temperatureRequireName: String,
        val temperatureRequireStart: Int,
        val tonnage: Int,
        val type: Int,
        val unloadNum: Int,
        val vehicleType: Int,
        val vehicleTypeCode: Int,
        val webUserId: Int
) : Parcelable {
    constructor(parcel: Parcel) : this(
            parcel.readString(),
            parcel.readInt(),
            parcel.readLong(),
            parcel.readInt(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readLong(),
            parcel.readString(),
            parcel.readLong(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readInt(),
            parcel.readString(),
            parcel.readInt(),
            parcel.readLong(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readInt(),
            TODO("isDistribution"),
            parcel.readByte() != 0.toByte(),
            parcel.readByte() != 0.toByte(),
            parcel.readByte() != 0.toByte(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readString(),
            parcel.readInt(),
            parcel.readString(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readLong(),
            parcel.readString(),
            parcel.readString(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readString(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readInt(),
            parcel.readInt()) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(soriginName)
        parcel.writeInt(adjustPrice)
        parcel.writeLong(arrivalTime)
        parcel.writeInt(bond)
        parcel.writeString(cancelReason)
        parcel.writeString(cancelResponsiblePerson)
        parcel.writeString(consignee)
        parcel.writeString(consigneeContactWay)
        parcel.writeString(consignor)
        parcel.writeString(consignorContactWay)
        parcel.writeLong(createTime)
        parcel.writeString(cube)
        parcel.writeLong(departureTime)
        parcel.writeString(destination)
        parcel.writeString(destinationName)
        parcel.writeString(driverId)
        parcel.writeString(driverPayServiceFee)
        parcel.writeString(feedbacks)
        parcel.writeString(goodsDescription)
        parcel.writeInt(goodsType)
        parcel.writeString(goodsTypeName)
        parcel.writeInt(id)
        parcel.writeLong(introduceCreateTime)
        parcel.writeInt(introduceFee)
        parcel.writeInt(introduceOrderNum)
        parcel.writeInt(introduceStatus)
        parcel.writeByte(if (isGreenPass) 1 else 0)
        parcel.writeByte(if (isMeatHook) 1 else 0)
        parcel.writeByte(if (isTailstock) 1 else 0)
        parcel.writeInt(kilometre)
        parcel.writeInt(loadNum)
        parcel.writeInt(orderIntroduceId)
        parcel.writeString(orderNum)
        parcel.writeInt(origin)
        parcel.writeString(originName)
        parcel.writeInt(paymentMethod)
        parcel.writeInt(proposalPrice)
        parcel.writeLong(receiptTime)
        parcel.writeString(salePayServiceFee)
        parcel.writeString(salePhone)
        parcel.writeInt(serviceId)
        parcel.writeInt(status)
        parcel.writeInt(temperatureRequireEnd)
        parcel.writeInt(temperatureRequireId)
        parcel.writeString(temperatureRequireName)
        parcel.writeInt(temperatureRequireStart)
        parcel.writeInt(tonnage)
        parcel.writeInt(type)
        parcel.writeInt(unloadNum)
        parcel.writeInt(vehicleType)
        parcel.writeInt(vehicleTypeCode)
        parcel.writeInt(webUserId)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<RecommendOrder> {
        override fun createFromParcel(parcel: Parcel): RecommendOrder {
            return RecommendOrder(parcel)
        }

        override fun newArray(size: Int): Array<RecommendOrder?> {
            return arrayOfNulls(size)
        }
    }
}